package product;

import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.FileOutputStream;
import java.io.ObjectOutputStream;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Vector;

import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.UIManager;
import javax.swing.border.BevelBorder;
import javax.swing.border.EmptyBorder;
import javax.swing.border.TitledBorder;
import javax.swing.table.DefaultTableModel;

public class MemberHoly extends JInternalFrame {

	Connection conn;
	PreparedStatement pstmt;
	ResultSetMetaData rsmd;
	ResultSet rs;
	Vector<String> v;
	MemberHolyselect mhs;


	HashMap<String, MemberData> mem; // 접근권한 얻어오기위한 해쉬맵
	HashMap<String, MemberData> holy; // 휴가 저장 해쉬맵
	DefaultTableModel model; // 휴가View
	DefaultComboBoxModel cmodel = new DefaultComboBoxModel<>(); // 년월일 콤보박스
	ProductMain pm; // main

	Date date = new Date();
	int day;
	Vector<String> vec;
	JTable tb;
	JComboBox jb;

	String yy,mm,dd;  // 년월일 입력값
	String YY,MM,DD; // 년월일 조회값

	HolyReason hr; // 사유서View창 관리자용
	HolyReason2 hr2; // 사유서 수정창 사원용
	String Reason = ""; //사유서view와 수정창에 보여지는 값을 저장할 변수


	//	월별 일수제한
	String[] h30 = {"", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30"};
	String[] h28 = {"", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28"};
	String[] h31 = {"", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30","31"};

	private JPanel contentPane;
	private JPanel LOGINnInput;
	private JPanel HOLY;
	private JPanel ECT;
	private JPanel holyMain;
	private JPanel holyInput;
	private JButton btnNewButton_1;
	private JPanel holypay;
	private JPanel holynotpay;
	private JLabel lblNewLabel_2;
	private JButton btnNewButton_2;
	private JButton button;
	private JButton button_1;
	private JPanel editorbtn;
	private JButton button_2;
	private JButton button_4;
	private JPanel ViewControl;
	private JPanel VIEW;
	private JButton button_5;
	private JButton button_6;
	private JPanel holyModify;
	private JButton button_7;
	private JButton button_8;
	private JButton button_9;
	private JButton button_10;
	private JButton button_11;
	private JPanel chulView;
	private JPanel reasonView;
	private JLabel lblNewLabel_5;
	private JLabel lblNewLabel_6;
	private JLabel lblNewLabel_7;
	private JLabel lblNewLabel_8;
	private JLabel lblNewLabel_9;
	private JScrollPane scrollPane;
	JTable ResultTable;
	private JButton btnNewButton_3;
	private JScrollPane scrollPane_1;
	JTextArea accident;
	private JScrollPane scrollPane_2;
	private JScrollPane scrollPane_3;
	JTextArea reason;
	JTextArea result;
	private JButton btnLogout_1;
	private JPanel resaoninput;
	private JButton btnNewButton_4;
	private JPanel serach;
	private JPanel LOGIN;
	private JPanel holyput;
	private JLabel label_6;
	JTextField userID;
	private JLabel label_7;
	private JPasswordField password;
	private JButton button_13;
	private JComboBox comboyy;
	private JLabel lblNewLabel;
	private JComboBox comboMM;
	private JLabel lblNewLabel_1;
	private JComboBox combodd;
	private JLabel lblNewLabel_11;
	private JLabel lblNewLabel_13;
	private JButton btnSerach;
	private JButton btnSerachAll;
	private JComboBox SerachY;
	private JComboBox SerachM;
	private JComboBox SerachD;
	private JLabel label;
	private JPanel editorble;
	private JPanel editormain;
	private JButton button_12;
	private JPanel holyeditor;
	private JTextField Begin;
	private JButton button_14;
	private JButton button_3;
	private JLabel lblNewLabel_3;
	private JLabel lblNewLabel_4;
	private JLabel lblNewLabel_10;
	private JLabel lblNewLabel_12;



	public MemberHoly(Connection conn,ProductMain p) {   // 생성자 매개변수

		super("휴가 관리",true,true,true,false);
		this.conn=conn;
		this.pm=p;

		Vector<String> colNames = new Vector<String>();
		colNames.add("Holyno");
		colNames.add("Memberid");
		colNames.add("Holydate");
		colNames.add("Holytype");
		colNames.add("Info");
		model = new DefaultTableModel(colNames, 0);



		setBounds(100, 100, 581, 488);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(contentPane);
		contentPane.add(getLOGINnInput(), BorderLayout.NORTH);
		contentPane.add(getHOLY(), BorderLayout.EAST);
		contentPane.add(getECT(), BorderLayout.SOUTH);
		contentPane.add(getViewControl(), BorderLayout.WEST);
		contentPane.add(getVIEW(), BorderLayout.CENTER);

	}
	public void setH(MemberHolyselect mhs){
		this.mhs=mhs;
	}


	public void connect_user(){

		try{
			if(userID.getText().equals("") && password.getText().equals("")){
				JOptionPane.showMessageDialog(null, "사원코드와 비밀번호를 확인해주세요.");
				userID.setText("");
				password.setText("");

			}else{

				String sql = "select * from memberdata where memberid=?";
				pstmt = conn.prepareStatement(sql);
				pstmt.setString(1, userID.getText());
				rs = pstmt.executeQuery();
				while(rs.next()){
					String key = rs.getString("pwd");
					if(key.equals(password.getText())){

						password.setText("");   // 접속햇을경우 비밀번호만 지움

						// 접속후 모든 휴가패널 활성화
						LOGIN.setVisible(false); 
						holyput.setVisible(true);
						HOLY.setVisible(true);
						ECT.setVisible(true);
						VIEW.setVisible(true);
						ViewControl.setVisible(true);
						editorble.setVisible(false); // 로그인패널 비활성화

						if(userID.getText().equals("AZ")){ //관리자로그인시 관리자 모드활성화
							editorble.setVisible(true);
						}
					}
				}
			}
		}catch(Exception e){
			e.printStackTrace();
		}

	}

	public void holyinput(String type){

		try{

			if(!yy.equals("") && !mm.equals("") && !dd.equals("")){
				int yn = -1; // 초기값

				if(type.equals("1")){
					yn = JOptionPane.showConfirmDialog(null, "월차를 신청하시겠습니까?");
				}else if(type.equals("2")){
					yn = JOptionPane.showConfirmDialog(null, "연차를 신청하시겠습니까?");
				}else if(type.equals("3")){
					yn = JOptionPane.showConfirmDialog(null, "생리휴가를 신청하시겠습니까?");
				}

				if(yn == JOptionPane.YES_OPTION){

					String nal = yy+"/"+mm+"/"+dd;

					String sql ="insert into holydata(holyno, memberid, holydate, holytype, info) "
							+ "values(holy_seq_no.nextval,?,?,?,?)";


					pstmt = conn.prepareStatement(sql);
					pstmt.setString(1, userID.getText());
					pstmt.setString(2, nal);
					pstmt.setString(3, type);
					if(type.equals("1")){
						pstmt.setString(4, "월차");
					}else if(type.equals("2")){
						pstmt.setString(4, "연차");
					}else if(type.equals("3")){
						pstmt.setString(4, "생리");
					}

					pstmt.executeUpdate();//입력,수정,삭제;

					JOptionPane.showMessageDialog(null, "신청 되었습니다");
					//초기화
					yy="";mm="";dd="";
					comboyy.setSelectedIndex(0);
					comboMM.setSelectedIndex(0);
					combodd.setSelectedIndex(0);
				}

			}else{
				JOptionPane.showMessageDialog(null, "신청할 날짜를 선택해주세요.");
			}
		}catch(Exception e){
			JOptionPane.showMessageDialog(null, "휴가 신청을 탭을 확인해주세요.");
		}

	}
	public void holymodify(String type){

		try{
			int row = -1;
			row = ResultTable.getSelectedRow();
			String hk = (String)model.getValueAt(ResultTable.getSelectedRow(), 1); // 사원코드
			String hkk = (String)model.getValueAt(row, 2); // 날짜
			String hkkk = (String)model.getValueAt(row, 3); // 휴가타입
			String hkkkk = (String)model.getValueAt(row, 4); // 휴가정보
			if(row != -1){

				if(!userID.getText().equals(hk)){
					JOptionPane.showMessageDialog(null, "사원의 휴가를 수정하실수 없습니다.");
				}else{

					if(hkkk.equals("0") && hkkkk.equals("회사내규")){
						JOptionPane.showMessageDialog(null, "무급휴가 기간입니다.");
					}else{

						int yn = -1;
						if(type.equals("1")){
							yn = JOptionPane.showConfirmDialog(null, "월차로 수정하시겠습니까?");
						}else if(type.equals("2")){
							yn = JOptionPane.showConfirmDialog(null, "연차로 수정하시겠습니까?");
						}else if(type.equals("3")){
							yn = JOptionPane.showConfirmDialog(null, "생리휴가로 수정 하시겠습니까?");
						}

						if(yn == JOptionPane.YES_OPTION){

							String nal = yy+"/"+mm+"/"+dd;

							String sql = "update holydata set holytype=?, info=? where memberid=? and holydate=?";


							pstmt = conn.prepareStatement(sql);
							pstmt.setString(1, userID.getText());
							pstmt.setString(2, nal);
							pstmt.setString(3, type);
							if(type.equals("1")){
								pstmt.setString(4, "월차");
							}else if(type.equals("2")){
								pstmt.setString(4, "연차");
							}else if(type.equals("3")){
								pstmt.setString(4, "생리");
							}

							pstmt.executeUpdate();//입력,수정,삭제;

							JOptionPane.showMessageDialog(null, "수정 되었습니다");

							String info="";
							if(type.equals("1")){
								info = "월차";
							}else if(type.equals("2")){
								info = "연차";
							}else if(type.equals("3")){
								info = "생리";
							}else if(type.equals("0")){
								info = "회사내규";
							}
							model.setValueAt((String)type,row, 3);
							model.setValueAt(info, row, 4);


							JOptionPane.showMessageDialog(null, "수정되었습니다. ");
						}else{
							JOptionPane.showMessageDialog(null, "취소되었습니다. ");
						}
					}
				}
			}

			else{
				JOptionPane.showMessageDialog(null, "수정하고자 하는 날짜를 선택하세요..");
			}
		}catch(Exception e){
			JOptionPane.showMessageDialog(null, "입력형식이 잘못되었습니다. ");
		}

	}

	public void holyserach(){
		
		pm.openholyselect();
		
		try{
			if (ResultTable!=null) ResultTable=null;

			if(userID.equals("AZ")){
				
				String sql = "select * from holydata";
				pstmt = conn.prepareStatement(sql);
				System.out.println("AZ");
			}else{
				String sql = "select * from holydata where memberid=?";
				pstmt = conn.prepareStatement(sql);
				pstmt.setString(1, userID.getText());
			}

			rs = pstmt.executeQuery();// 리절트셋에 대한 부가정보를 갖는 객체얻어오기
			rsmd = rs.getMetaData();

			int colCount = rsmd.getColumnCount();

			while (rs.next()) {
				v= new Vector<String>();
				v.add(rs.getString("holyno"));
				v.add(rs.getString("memberid"));
				v.add(rs.getString("holydate"));
				v.add(rs.getString("holytype"));
				v.add(rs.getString("info"));
				model.addRow(v);
			}
			//			ResultTable.setModel(model);


		}catch(Exception e){

		}
	}


	private JButton getBtnNewButton_1() {
		if (btnNewButton_1 == null) {
			btnNewButton_1 = new JButton("휴가신청"); // 신청 탭활성화
			btnNewButton_1.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent arg0) {

					holyMain.setVisible(false);
					holyput.setVisible(true);
					holyInput.setVisible(true);

				}
			});
			btnNewButton_1.setBounds(12, 10, 90, 23);
		}
		return btnNewButton_1;
	}


	private JPanel getLOGINnInput() {
		if (LOGINnInput == null) {
			LOGINnInput = new JPanel();
			LOGINnInput.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));
			LOGINnInput.setLayout(new CardLayout(0, 0));
			LOGINnInput.add(getLOGIN(), "name_39616374379233");
			LOGINnInput.add(getHolyput(), "name_39638304307443");
		}
		return LOGINnInput;
	}
	private JPanel getHOLY() {
		if (HOLY == null) {
			HOLY = new JPanel();
			HOLY.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));
			HOLY.setPreferredSize(new Dimension(110, 10));
			HOLY.setLayout(new CardLayout(0, 0));
			HOLY.add(getHolyMain(), "name_8330428065663");
			HOLY.add(getHolyInput(), "name_8336521361165");
			HOLY.add(getPanel_5(), "name_20770618232552");
			HOLY.setVisible(false);
		}
		return HOLY;
	}
	private JPanel getECT() {
		if (ECT == null) {
			ECT = new JPanel();
			ECT.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));
			ECT.setPreferredSize(new Dimension(10, 50));
			ECT.setLayout(new CardLayout(0, 0));
			ECT.add(getSerach(), "name_28789105748533");
			ECT.add(getResaoninput(), "name_27866658764509");
			ECT.setVisible(false);
		}
		return ECT;
	}
	private JPanel getHolyMain() {
		if (holyMain == null) {
			holyMain = new JPanel();
			holyMain.setLayout(null);
			holyMain.add(getBtnNewButton_1());
			holyMain.add(getButton_5());
			holyMain.add(getButton_6());
		}
		return holyMain;
	}
	private JPanel getHolyInput() {
		if (holyInput == null) {
			holyInput = new JPanel();
			GridBagLayout gbl_holyInput = new GridBagLayout();
			gbl_holyInput.columnWidths = new int[]{0, 0};
			gbl_holyInput.rowHeights = new int[]{0, 0, 0};
			gbl_holyInput.columnWeights = new double[]{1.0, Double.MIN_VALUE};
			gbl_holyInput.rowWeights = new double[]{1.0, 1.0, Double.MIN_VALUE};
			holyInput.setLayout(gbl_holyInput);
			getHolypay().setLayout(null);
			GridBagConstraints gbc_holypay = new GridBagConstraints();
			gbc_holypay.insets = new Insets(0, 0, 5, 0);
			gbc_holypay.fill = GridBagConstraints.BOTH;
			gbc_holypay.gridx = 0;
			gbc_holypay.gridy = 0;
			holyInput.add(getHolypay(), gbc_holypay);
			GridBagConstraints gbc_holynotpay = new GridBagConstraints();
			gbc_holynotpay.fill = GridBagConstraints.BOTH;
			gbc_holynotpay.gridx = 0;
			gbc_holynotpay.gridy = 1;
			holyInput.add(getHolynotpay(), gbc_holynotpay);
		}
		return holyInput;
	}

	private JPanel getHolypay() {
		if (holypay == null) {
			holypay = new JPanel();
			holypay.add(getLblNewLabel_2());
			holypay.add(getBtnNewButton_2());
			holypay.add(getButton());
			holypay.add(getButton_1());
			holypay.add(getButton_4());
		}
		return holypay;
	}
	private JPanel getHolynotpay() {
		if (holynotpay == null) {
			holynotpay = new JPanel();
			holynotpay.setLayout(new CardLayout(0, 0));
			holynotpay.add(getEditorbtn(), "name_9244459442187");
		}
		return holynotpay;
	}
	private JLabel getLblNewLabel_2() {
		if (lblNewLabel_2 == null) {
			lblNewLabel_2 = new JLabel("유급 휴가 신청");
			lblNewLabel_2.setHorizontalAlignment(SwingConstants.CENTER);
			lblNewLabel_2.setBounds(0, 0, 100, 15);
		}
		return lblNewLabel_2;
	}
	private JButton getBtnNewButton_2() {
		if (btnNewButton_2 == null) {
			btnNewButton_2 = new JButton("월차신청");
			btnNewButton_2.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent arg0) {


					holyinput("1");

				}
			});
			btnNewButton_2.setBounds(10, 25, 90, 23);
		}
		return btnNewButton_2;
	}
	private JButton getButton() {
		if (button == null) {
			button = new JButton("연차신청");
			button.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent arg0) {

					holyinput("2");

				}
			});
			button.setBounds(10, 58, 90, 23);
		}
		return button;
	}
	private JButton getButton_1() {
		if (button_1 == null) {
			button_1 = new JButton("생리휴가");
			button_1.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent arg0) {

					holyinput("3");

				}
			});
			button_1.setBounds(10, 91, 90, 23);
		}
		return button_1;
	}
	private JPanel getEditorbtn() {
		if (editorbtn == null) {
			editorbtn = new JPanel();
			editorbtn.setLayout(null);
			editorbtn.add(getButton_2());
		}
		return editorbtn;
	}
	private JButton getButton_2() {
		if (button_2 == null) {
			button_2 = new JButton("이전단계"); // 이전단계 패널로 이동
			button_2.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent arg0) {

					holyMain.setVisible(true);
					holyInput.setVisible(false);

				}
			});
			button_2.setBounds(12, 147, 90, 23);
		}
		return button_2;
	}
	private JButton getButton_4() {
		if (button_4 == null) {
			button_4 = new JButton("기타"); // 사유서신청시 사유서창과 사유서저장버튼 패널활성화
			button_4.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent arg0) {

					chulView.setVisible(false);
					reasonView.setVisible(true);
					resaoninput.setVisible(true);
					serach.setVisible(false);


				}
			});
			button_4.setBounds(10, 124, 90, 23);
		}
		return button_4;
	}
	private JPanel getViewControl() {
		if (ViewControl == null) {
			ViewControl = new JPanel();
			ViewControl.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));
			ViewControl.setPreferredSize(new Dimension(100, 10));
			ViewControl.setLayout(null);
			ViewControl.add(getBtnNewButton_3());
			ViewControl.add(getBtnLogout_1());
			ViewControl.add(getEditorble());
			ViewControl.setVisible(false);
		}
		return ViewControl;
	}
	private JPanel getVIEW() {
		if (VIEW == null) {
			VIEW = new JPanel();
			VIEW.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));
			VIEW.setLayout(new CardLayout(0, 0));
			VIEW.add(getChulView(), "name_21151974881175");
			VIEW.add(getReasonView(), "name_21841486159679");
			VIEW.setVisible(false);
		}
		return VIEW;
	}
	private JButton getButton_5() {
		if (button_5 == null) {
			button_5 = new JButton("수정");
			button_5.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent arg0) {
					holyModify.setVisible(true);
					holyMain.setVisible(false);
				}
			});
			button_5.setBounds(12, 43, 90, 23);
		}
		return button_5;
	}
	private JButton getButton_6() {
		if (button_6 == null) {
			button_6 = new JButton("삭제");
			button_6.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {

					try{

						int row = -1;
						row = ResultTable.getSelectedRow();
						String hk = (String)model.getValueAt(ResultTable.getSelectedRow(), 0); // 날짜
						String hkk = (String)model.getValueAt(ResultTable.getSelectedRow(), 1); // 사원코드
						String hkkk = (String)model.getValueAt(row, 2); // 유급여부
						String hkkkk = (String)model.getValueAt(row, 3); // 무급커맨드

						if(row != -1){

							if(!userID.getText().equals(hkk)){
								JOptionPane.showMessageDialog(null, "사원의 휴가를 수정하실수 없습니다.");
							}else{
								if(hkkk.equals("0") && hkkkk.equals("회사내규")){
									JOptionPane.showMessageDialog(null, "무급휴가 기간입니다.");
								}else{


									int yn = JOptionPane.showConfirmDialog(null, "정말 삭제 하시겠습니까? ");
									if(yn == JOptionPane.YES_OPTION){

										model.removeRow(row);
										holy.remove("["+hkk+"]"+hk); // [사원코드]날짜 key 삭제
										//파일 백업
//										oos = new ObjectOutputStream(new FileOutputStream("/MemberManage/Holy"));
//										oos.writeObject(pm.holy);
//										oos.close();


										JOptionPane.showMessageDialog(null, "삭제 되었습니다.");
									}else{
										JOptionPane.showMessageDialog(null, "삭제가 취소되었습니다. ");
									}
								}
							}
						}
						else{
							JOptionPane.showMessageDialog(null, "삭제하고자 하는 항목을 선택하세요. ");
						}
					}catch(Exception ee){
						JOptionPane.showMessageDialog(null, "입력형식이 잘못되었습니다.");
					}

				}
			});
			button_6.setBounds(12, 76, 90, 23);
		}
		return button_6;
	}
	private JPanel getPanel_5() {
		if (holyModify == null) {
			holyModify = new JPanel();
			holyModify.setLayout(null);
			holyModify.add(getButton_7());
			holyModify.add(getButton_8());
			holyModify.add(getButton_9());
			holyModify.add(getButton_10());
			holyModify.add(getButton_11());
			holyModify.add(getLabel());
		}
		return holyModify;
	}
	private JButton getButton_7() {
		if (button_7 == null) {
			button_7 = new JButton("월차");
			button_7.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent arg0) {

					holymodify("1");

				}
			});
			button_7.setBounds(12, 24, 90, 23);
		}
		return button_7;
	}
	private JButton getButton_8() {
		if (button_8 == null) {
			button_8 = new JButton("연차");
			button_8.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent arg0) {

					holymodify("2");

				}
			});
			button_8.setBounds(12, 57, 90, 23);
		}
		return button_8;
	}
	private JButton getButton_9() {
		if (button_9 == null) {
			button_9 = new JButton("생리");
			button_9.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent arg0) {

					holymodify("3");

				}
			});
			button_9.setBounds(12, 90, 90, 23);
		}
		return button_9;
	}
	private JButton getButton_10() {
		if (button_10 == null) {
			button_10 = new JButton("기타"); // 사유서 수정시
			button_10.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent arg0) {


					try{
						int row = -1;
						row = ResultTable.getSelectedRow();
						String hk = (String)model.getValueAt(row, 0); // 사유서 창에 띄우기위해 날짜를 비교할 값
						String hkk = (String)model.getValueAt(row, 1); // 사원코드
						String hkkk = (String)model.getValueAt(row, 2); // 유급여부
						String hkkkk = (String)model.getValueAt(row, 3); // 무급여부가 사유서결격일경우 수정하기위한 조건

						if(row != -1){

							if(!userID.getText().equals(hkk)){ // 관리자도 사원의 휴가는 수정할수 없음
								JOptionPane.showMessageDialog(null, "사원의 휴가를 수정하실수 없습니다.");
							}else if(hkkk.equals("0") && hkkkk.equals("회사내규")){ // 무급휴가기간엔 수정불가
								JOptionPane.showMessageDialog(null, "무급휴가 기간입니다.");
							}
							else{
								// 사유서 수정창을 불러들일때 기존에 입력한 값을 찾아 뿌려준다
								Collection<String> ct = holy.keySet();
								Iterator<String> it = ct.iterator();
								while(it.hasNext()){
									MemberData md = holy.get(it.next());
									if(md.getHolydate().equals(hk)){
										Reason = md.getReason();
										hr2 = new HolyReason2(holy,MemberHoly.this);
										hr2.setVisible(true);

									}
								}
							}

						}
						else{
							JOptionPane.showMessageDialog(null, "수정하고자 하는 항목을 선택해주세요");
						}

					}catch(Exception eee){
						JOptionPane.showMessageDialog(null, "입력형식이 잘못되었습니다.");
					}




				}
			});
			button_10.setBounds(12, 123, 90, 23);
		}
		return button_10;
	}
	private JButton getButton_11() {
		if (button_11 == null) {
			button_11 = new JButton("이전단계"); // 휴가메인 패널로 이동
			button_11.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent arg0) {


					holyModify.setVisible(false);
					holyMain.setVisible(true);


				}
			});
			button_11.setBounds(12, 324, 90, 23);
		}
		return button_11;
	}
	private JPanel getChulView() {
		if (chulView == null) {
			chulView = new JPanel();
			chulView.setLayout(new BorderLayout(0, 0));
			chulView.add(getScrollPane(), BorderLayout.CENTER);
		}
		return chulView;
	}
	private JPanel getReasonView() {
		if (reasonView == null) {
			reasonView = new JPanel();
			GridBagLayout gbl_reasonView = new GridBagLayout();
			gbl_reasonView.columnWidths = new int[]{0, 0, 0};
			gbl_reasonView.rowHeights = new int[]{0, 0, 0, 0, 0};
			gbl_reasonView.columnWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
			gbl_reasonView.rowWeights = new double[]{0.0, 1.0, 1.0, 1.0, Double.MIN_VALUE};
			reasonView.setLayout(gbl_reasonView);
			GridBagConstraints gbc_lblNewLabel_5 = new GridBagConstraints();
			gbc_lblNewLabel_5.insets = new Insets(0, 0, 5, 5);
			gbc_lblNewLabel_5.gridx = 0;
			gbc_lblNewLabel_5.gridy = 0;
			reasonView.add(getLblNewLabel_5(), gbc_lblNewLabel_5);
			GridBagConstraints gbc_lblNewLabel_6 = new GridBagConstraints();
			gbc_lblNewLabel_6.insets = new Insets(0, 0, 5, 0);
			gbc_lblNewLabel_6.gridx = 1;
			gbc_lblNewLabel_6.gridy = 0;
			reasonView.add(getLblNewLabel_6(), gbc_lblNewLabel_6);
			GridBagConstraints gbc_lblNewLabel_7 = new GridBagConstraints();
			gbc_lblNewLabel_7.anchor = GridBagConstraints.EAST;
			gbc_lblNewLabel_7.insets = new Insets(0, 0, 5, 5);
			gbc_lblNewLabel_7.gridx = 0;
			gbc_lblNewLabel_7.gridy = 1;
			reasonView.add(getLblNewLabel_7(), gbc_lblNewLabel_7);
			GridBagConstraints gbc_scrollPane_1 = new GridBagConstraints();
			gbc_scrollPane_1.insets = new Insets(0, 0, 5, 0);
			gbc_scrollPane_1.fill = GridBagConstraints.BOTH;
			gbc_scrollPane_1.gridx = 1;
			gbc_scrollPane_1.gridy = 1;
			reasonView.add(getScrollPane_1(), gbc_scrollPane_1);
			GridBagConstraints gbc_lblNewLabel_8 = new GridBagConstraints();
			gbc_lblNewLabel_8.anchor = GridBagConstraints.EAST;
			gbc_lblNewLabel_8.insets = new Insets(0, 0, 5, 5);
			gbc_lblNewLabel_8.gridx = 0;
			gbc_lblNewLabel_8.gridy = 2;
			reasonView.add(getLblNewLabel_8(), gbc_lblNewLabel_8);
			GridBagConstraints gbc_scrollPane_2 = new GridBagConstraints();
			gbc_scrollPane_2.insets = new Insets(0, 0, 5, 0);
			gbc_scrollPane_2.fill = GridBagConstraints.BOTH;
			gbc_scrollPane_2.gridx = 1;
			gbc_scrollPane_2.gridy = 2;
			reasonView.add(getScrollPane_2(), gbc_scrollPane_2);
			GridBagConstraints gbc_lblNewLabel_9 = new GridBagConstraints();
			gbc_lblNewLabel_9.anchor = GridBagConstraints.EAST;
			gbc_lblNewLabel_9.insets = new Insets(0, 0, 0, 5);
			gbc_lblNewLabel_9.gridx = 0;
			gbc_lblNewLabel_9.gridy = 3;
			reasonView.add(getLblNewLabel_9(), gbc_lblNewLabel_9);
			GridBagConstraints gbc_scrollPane_3 = new GridBagConstraints();
			gbc_scrollPane_3.fill = GridBagConstraints.BOTH;
			gbc_scrollPane_3.gridx = 1;
			gbc_scrollPane_3.gridy = 3;
			reasonView.add(getScrollPane_3(), gbc_scrollPane_3);
		}
		return reasonView;
	}
	private JLabel getLblNewLabel_5() {
		if (lblNewLabel_5 == null) {
			lblNewLabel_5 = new JLabel("");
		}
		return lblNewLabel_5;
	}
	private JLabel getLblNewLabel_6() {
		if (lblNewLabel_6 == null) {
			lblNewLabel_6 = new JLabel("내용");
		}
		return lblNewLabel_6;
	}
	private JLabel getLblNewLabel_7() {
		if (lblNewLabel_7 == null) {
			lblNewLabel_7 = new JLabel("사고");
			lblNewLabel_7.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));
			lblNewLabel_7.setHorizontalAlignment(SwingConstants.CENTER);
			lblNewLabel_7.setPreferredSize(new Dimension(80, 105));
		}
		return lblNewLabel_7;
	}
	private JLabel getLblNewLabel_8() {
		if (lblNewLabel_8 == null) {
			lblNewLabel_8 = new JLabel("사유");
			lblNewLabel_8.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));
			lblNewLabel_8.setHorizontalAlignment(SwingConstants.CENTER);
			lblNewLabel_8.setPreferredSize(new Dimension(80, 105));
		}
		return lblNewLabel_8;
	}
	private JLabel getLblNewLabel_9() {
		if (lblNewLabel_9 == null) {
			lblNewLabel_9 = new JLabel("처리");
			lblNewLabel_9.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));
			lblNewLabel_9.setHorizontalAlignment(SwingConstants.CENTER);
			lblNewLabel_9.setPreferredSize(new Dimension(80, 105));
		}
		return lblNewLabel_9;
	}
	private JScrollPane getScrollPane() {
		if (scrollPane == null) {
			scrollPane = new JScrollPane();
			scrollPane.setViewportView(getResultTable());
		}
		return scrollPane;
	}
	private JTable getResultTable() {
		if (ResultTable == null) {
			ResultTable = new JTable(model);
			ResultTable.addMouseListener(new MouseAdapter() {
				@Override
				public void mousePressed(MouseEvent arg0) {


					int row;
					row = ResultTable.getSelectedRow();
					String nal = (String)model.getValueAt(row, 0); // 사유서 창에 띄우기우기위해 날짜를 비교할값
					String key = (String)model.getValueAt(row, 2); // 기타(4)일경우만 창을 띄우기위한 조건
					// 관리자전용 사유서 승인뷰
					if(key.equals("4") && userID.getText().equals("A1")){


						Collection<String> ct = holy.keySet();
						Iterator<String> it = ct.iterator();
						while(it.hasNext()){
							MemberData md = holy.get(it.next());
							if(md.getHolydate().equals(nal)){
								Reason = md.getReason();
								hr = new HolyReason(holy,MemberHoly.this);
								hr.setVisible(true);

							}
						}
					}


				}
			});
		}
		return ResultTable;
	}
	private JButton getBtnNewButton_3() {
		if (btnNewButton_3 == null) {
			btnNewButton_3 = new JButton("현황"); // 조회테이블 패널과 조회버튼패널로 이동
			btnNewButton_3.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent arg0) {

					chulView.setVisible(true);
					reasonView.setVisible(false);
					resaoninput.setVisible(false);
					serach.setVisible(true);

				}
			});
			btnNewButton_3.setBounds(12, 10, 76, 23);
		}
		return btnNewButton_3;
	}
	private JScrollPane getScrollPane_1() {
		if (scrollPane_1 == null) {
			scrollPane_1 = new JScrollPane();
			scrollPane_1.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));
			scrollPane_1.setPreferredSize(new Dimension(80, 100));
			scrollPane_1.setViewportView(getAccident());
		}
		return scrollPane_1;
	}
	private JTextArea getAccident() {
		if (accident == null) {
			accident = new JTextArea();
		}
		return accident;
	}
	private JScrollPane getScrollPane_2() {
		if (scrollPane_2 == null) {
			scrollPane_2 = new JScrollPane();
			scrollPane_2.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));
			scrollPane_2.setViewportView(getReason());
		}
		return scrollPane_2;
	}
	private JScrollPane getScrollPane_3() {
		if (scrollPane_3 == null) {
			scrollPane_3 = new JScrollPane();
			scrollPane_3.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));
			scrollPane_3.setViewportView(getResult());
		}
		return scrollPane_3;
	}
	private JTextArea getReason() {
		if (reason == null) {
			reason = new JTextArea();
		}
		return reason;
	}
	private JTextArea getResult() {
		if (result == null) {
			result = new JTextArea();
		}
		return result;
	}
	private JButton getBtnLogout_1() {
		if (btnLogout_1 == null) {
			btnLogout_1 = new JButton("Logout"); // 로그아웃버튼클릭시 모든 패널을 닫고 JTable을 초기화
			btnLogout_1.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent arg0) {

					HOLY.setVisible(false);
					ECT.setVisible(false);
					ViewControl.setVisible(false);
					VIEW.setVisible(false);
					LOGIN.setVisible(true);
					holyput.setVisible(false);

					if(model!=null){
						for(int i=model.getRowCount()-1;i>=0;i--){
							model.removeRow(i);
						}
					}


				}
			});
			btnLogout_1.setBounds(12, 158, 76, 23);
		}
		return btnLogout_1;
	}
	private JPanel getResaoninput() {
		if (resaoninput == null) {
			resaoninput = new JPanel();
			resaoninput.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
			resaoninput.add(getBtnNewButton_4());
		}
		return resaoninput;
	}
	private JButton getBtnNewButton_4() {
		if (btnNewButton_4 == null) {
			btnNewButton_4 = new JButton("사유서 저장"); 
			btnNewButton_4.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent arg0) {


					try{

						if(!yy.equals("") || !mm.equals("") || !dd.equals("")){ // 신청일이 공백이면 신청불가


							int yn = JOptionPane.showConfirmDialog(null, "사유서를 저장하시겠습니까?");
							if(yn == JOptionPane.YES_OPTION){

								MemberData md = new MemberData(userID.getText(), yy+mm+dd, "4", "심사중",
										accident.getText()+"%"
												+ reason.getText()+"%"
												+ result.getText());

								holy.put("["+userID.getText()+"]"+yy+mm+dd, md);
								System.out.println(md.getCode() +"\n"+ md.getHolydate()+"\n"+md.getYholy()+"\n"+md.getReason());

								JOptionPane.showMessageDialog(null, "신청 되었습니다");

								yy="";mm="";dd="";
								accident.setText("");
								reason.setText("");
								result.setText("");
								comboyy.setSelectedIndex(0);
								comboMM.setSelectedIndex(0);
								combodd.setSelectedIndex(0);
							}

						}else{
							JOptionPane.showMessageDialog(null, "신청할 날짜를 선택해주세요.");
						}
					}catch(Exception e){

					}



				}
			});
		}
		return btnNewButton_4;
	}
	private JPanel getSerach() {
		if (serach == null) {
			serach = new JPanel();
			serach.add(getSerachY());
			serach.add(getLblNewLabel_3());
			serach.add(getSerachM());
			serach.add(getLblNewLabel_4());
			serach.add(getSerachD());
			serach.add(getLblNewLabel_10());
			serach.add(getBtnSerach());
			serach.add(getBtnSerachAll());
		}
		return serach;
	}
	private JPanel getLOGIN() {
		if (LOGIN == null) {
			LOGIN = new JPanel();
			LOGIN.add(getLabel_6());
			LOGIN.add(getUserID());
			LOGIN.add(getLabel_7());
			LOGIN.add(getPassword());
			LOGIN.add(getButton_13());
		}
		return LOGIN;
	}
	private JPanel getHolyput() {
		if (holyput == null) {
			holyput = new JPanel();
			holyput.add(getLblNewLabel_13());
			holyput.add(getComboyy());
			holyput.add(getLblNewLabel());
			holyput.add(getComboMM());
			holyput.add(getLblNewLabel_1());
			holyput.add(getCombodd());
			holyput.add(getLblNewLabel_11());
		}
		return holyput;
	}
	private JLabel getLabel_6() {
		if (label_6 == null) {
			label_6 = new JLabel("사원 번호");
		}
		return label_6;
	}
	private JTextField getUserID() {
		if (userID == null) {
			userID = new JTextField();
			userID.setPreferredSize(new Dimension(50, 21));
			userID.setColumns(10);
		}
		return userID;
	}
	private JLabel getLabel_7() {
		if (label_7 == null) {
			label_7 = new JLabel("패스워드");
		}
		return label_7;
	}
	private JPasswordField getPassword() {
		if (password == null) {
			password = new JPasswordField();
			password.setPreferredSize(new Dimension(100, 21));
		}
		return password;
	}
	private JButton getButton_13() {
		if (button_13 == null) {
			button_13 = new JButton("접속"); 
			button_13.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent arg0) {

					connect_user();

				}
			});
		}
		return button_13;
	}
	private JComboBox getComboyy() {
		if (comboyy == null) {
			comboyy = new JComboBox();
			comboyy.addItemListener(new ItemListener() {
				public void itemStateChanged(ItemEvent e) {
					if(e.getStateChange() == e.SELECTED){ // 콤보박스 값이 선택되었을경우
						yy = (String)(e.getItem());
					}
				}
			});
			comboyy.setModel(new DefaultComboBoxModel(new String[] {"", "2014", "2015", "2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023", "2024"}));
		}
		return comboyy;
	}
	private JLabel getLblNewLabel() {
		if (lblNewLabel == null) {
			lblNewLabel = new JLabel("년");
		}
		return lblNewLabel;
	}
	private JComboBox getComboMM() {
		if (comboMM == null) {
			comboMM = new JComboBox();
			comboMM.addItemListener(new ItemListener() {
				public void itemStateChanged(ItemEvent e) {
					if(e.getStateChange() == e.SELECTED){
						cmodel.removeAllElements();
						mm = (String)(e.getItem());
						// 4,6,9,11월은 30일까지 나옴
						if(mm.equals("04") || mm.equals("06") || mm.equals("09") || mm.equals("11")){
							cmodel.addElement("");
							for(int i=1;i<=30;i++){
								if(i<10){
									cmodel.addElement("0"+Integer.toString(i));
								}else{
									cmodel.addElement(Integer.toString(i));
								}
							}
							// 2월은 28일까지 나옴
						}else if(mm.equals("02")){
							cmodel.addElement("");
							for(int i=1;i<=28;i++){
								if(i<10){
									cmodel.addElement("0"+Integer.toString(i));
								}else{
									cmodel.addElement(Integer.toString(i));
								}
							}
							// 1,3,5,7,8,10,12월은 30일까지 나옴
						}else{
							cmodel.addElement("");
							for(int i=1;i<=31;i++){
								if(i<10){
									cmodel.addElement("0"+Integer.toString(i));
								}else{
									cmodel.addElement(Integer.toString(i));
								}
							}
						}
						//						System.out.println(cmodel.getSize());
						combodd.setModel(cmodel); // 월별에 따른 일수 갱신

					}
				}
			});
			comboMM.setModel(new DefaultComboBoxModel(new String[] {"", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"}));
		}
		return comboMM;
	}
	private JLabel getLblNewLabel_1() {
		if (lblNewLabel_1 == null) {
			lblNewLabel_1 = new JLabel("월");
		}
		return lblNewLabel_1;
	}
	private JComboBox getCombodd() {
		if (combodd == null) {
			combodd = new JComboBox(cmodel);
			combodd.addItemListener(new ItemListener() {
				public void itemStateChanged(ItemEvent e) {
					if(e.getStateChange() == e.SELECTED){
						dd = (String) (e.getItem());
					}
				}
			});
			//			combodd.setModel(new DefaultComboBoxModel(h30));

		}
		return combodd;
	}
	private JLabel getLblNewLabel_11() {
		if (lblNewLabel_11 == null) {
			lblNewLabel_11 = new JLabel("일");
		}
		return lblNewLabel_11;
	}
	private JLabel getLblNewLabel_13() {
		if (lblNewLabel_13 == null) {
			lblNewLabel_13 = new JLabel("휴가 신청일");
		}
		return lblNewLabel_13;
	}
	private JButton getBtnSerach() {
		if (btnSerach == null) {
			btnSerach = new JButton("조회");
			btnSerach.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent arg0) {



					try{
						//테이블 초기화
						for(int i=model.getRowCount()-1;i>=0;i--){
							model.removeRow(i);
						}



						if(YY.equals("") && MM.equals("") && DD.equals("")){ // 년별 월별 일별로 조회가능
							JOptionPane.showMessageDialog(null, "조회할 값을 선택해 주세요 ");
						}else{

							Collection<String> col = holy.keySet();
							Iterator<String> it = col.iterator();
							while(it.hasNext()){
								String key = it.next();
								MemberData d = holy.get(key);

								// [입력아이디]날짜가 키값과 같을경우
								if( ("["+userID.getText()+"]"+d.getHolydate()).equals(key) ){ // 사원


									if(d.getHolydate().substring(0, 4).equals(YY) || d.getHolydate().substring(4, 2).equals(MM) || d.getHolydate().substring(6, 2).equals(DD)){ 
										//find값이 Holydata에 포함되어있을경우

										vec = new Vector<String>();
										vec.add(d.getHolydate());
										vec.add(d.getCode());
										vec.add(d.getYholy());
										vec.add(d.getMholy());
										model.addRow(vec);

										ResultTable = new JTable(model);

										YY="";MM="";DD="";
										SerachY.setSelectedIndex(0);
										SerachM.setSelectedIndex(0);
										SerachD.setSelectedIndex(0);

									}

								}else if(userID.getText().equals("A1")){ //관리자

									if(d.getHolydate().substring(0, 4).equals(YY) || d.getHolydate().substring(4, 2).equals(MM) || d.getHolydate().substring(6, 2).equals(DD)){ 
										//find값이 Holydata에 포함되어있을경우

										System.out.println(d.getHolydate().substring(0,4));
										System.out.println(YY);
										System.out.println(MM);
										System.out.println(d.getHolydate().substring(4,2));
										vec = new Vector<String>();
										vec.add(d.getHolydate());
										vec.add(d.getCode());
										vec.add(d.getYholy());
										vec.add(d.getMholy());
										model.addRow(vec);

										ResultTable = new JTable(model);

										YY="";MM="";DD="";
										SerachY.setSelectedIndex(0);
										SerachM.setSelectedIndex(0);
										SerachD.setSelectedIndex(0);

									}
								}
							}
						}
					}catch(Exception e){

					}



				}
			});
		}
		return btnSerach;
	}
	private JButton getBtnSerachAll() {
		if (btnSerachAll == null) {
			btnSerachAll = new JButton("모두 조회");
			btnSerachAll.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent arg0) {

					//					for(int i=model.getRowCount()-1;i>=0;i--){
					//						model.removeRow(i);
					//					}

					holyserach();

				}
			});
		}
		return btnSerachAll;
	}
	private JComboBox getSerachY() {
		if (SerachY == null) {
			SerachY = new JComboBox();
			SerachY.addItemListener(new ItemListener() {
				public void itemStateChanged(ItemEvent e) {

					if(e.getStateChange() == e.SELECTED){ // 콤보박스 값이 선택되었을경우
						YY = (String)(e.getItem()); 
					}

				}
			});
			SerachY.setModel(new DefaultComboBoxModel(new String[] {"", "2014", "2015", "2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023", "2024"}));
		}
		return SerachY;
	}
	private JComboBox getSerachM() {
		if (SerachM == null) {
			SerachM = new JComboBox();
			SerachM.addItemListener(new ItemListener() {
				public void itemStateChanged(ItemEvent e) {

					if(e.getStateChange() == e.SELECTED){ // 콤보박스 값이 선택되었을경우

						cmodel.removeAllElements();
						MM = (String)(e.getItem());

						if(MM.equals("04") || MM.equals("06") || MM.equals("09") || MM.equals("11")){
							cmodel.addElement("");
							for(int i=1;i<=30;i++){
								if(i<10){
									cmodel.addElement("0"+Integer.toString(i));
								}else{
									cmodel.addElement(Integer.toString(i));
								}
							}

						}else if(MM.equals("02")){
							cmodel.addElement("");
							for(int i=1;i<=28;i++){
								if(i<10){
									cmodel.addElement("0"+Integer.toString(i));
								}else{
									cmodel.addElement(Integer.toString(i));
								}
							}

						}else{
							cmodel.addElement("");
							for(int i=1;i<=31;i++){
								if(i<10){
									cmodel.addElement("0"+Integer.toString(i));
								}else{
									cmodel.addElement(Integer.toString(i));
								}
							}
						}
						//						System.out.println(cmodel.getSize());
						SerachD.setModel(cmodel);

					}

				}
			});
			SerachM.setModel(new DefaultComboBoxModel(new String[] {"", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"}));
		}
		return SerachM;
	}
	private JComboBox getSerachD() {
		if (SerachD == null) {
			SerachD = new JComboBox(cmodel);
			SerachD.addItemListener(new ItemListener() {
				public void itemStateChanged(ItemEvent e) {



					if(e.getStateChange() == e.SELECTED){ // 콤보박스 값이 선택되었을경우
						DD = (String)(e.getItem());
					}


				}
			});
			SerachD.setModel(new DefaultComboBoxModel(h30));
		}
		return SerachD;
	}
	private JLabel getLabel() {
		if (label == null) {
			label = new JLabel("유급 휴가 수정");
			label.setHorizontalAlignment(SwingConstants.CENTER);
			label.setBounds(2, 0, 100, 15);
		}
		return label;
	}
	private JPanel getEditorble() {
		if (editorble == null) {
			editorble = new JPanel();
			editorble.setBounds(5, 191, 95, 170);
			editorble.setLayout(new CardLayout(0, 0));
			editorble.add(getEditormain(), "name_2378880706816");
			editorble.add(getHolyeditor(), "name_3288643143897");
		}
		return editorble;
	}
	private JPanel getEditormain() {
		if (editormain == null) {
			editormain = new JPanel();
			editormain.setLayout(null);
			editormain.add(getButton_12_1());
		}
		return editormain;
	}
	private JButton getButton_12_1() {
		if (button_12 == null) {
			button_12 = new JButton("관리자");
			button_12.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					editormain.setVisible(false);
					holyeditor.setVisible(true);
				}
			});
			button_12.setBounds(7, 10, 76, 23);
		}
		return button_12;
	}
	private JPanel getHolyeditor() {
		if (holyeditor == null) {
			holyeditor = new JPanel();
			holyeditor.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\uBB34\uAE09\uD734\uAC00", TitledBorder.CENTER, TitledBorder.TOP, null, new Color(0, 0, 0)));
			holyeditor.setLayout(null);
			holyeditor.add(getBegin());
			holyeditor.add(getButton_14());
			holyeditor.add(getButton_3_1());
			holyeditor.add(getLblNewLabel_12());
		}
		return holyeditor;
	}
	private JTextField getBegin() {
		if (Begin == null) {
			Begin = new JTextField();
			Begin.setColumns(10);
			Begin.setBounds(10, 29, 73, 21);
		}
		return Begin;
	}


	private JButton getButton_14() {
		if (button_14 == null) {
			button_14 = new JButton("적용");
			button_14.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {


					if(Begin.getText().equals("")){
						JOptionPane.showMessageDialog(null, "yyyyMMdd 형식으로 적용날짜를 입력해주세요.");
					}else{

						Collection<MemberData> ct = mem.values();
						Iterator<MemberData> it = ct.iterator();

						while(it.hasNext()){
							MemberData md = it.next();
							MemberData mdd = new MemberData(md.getCode(),Begin.getText(),"0","회사내규",null);

							holy.put("["+md.getCode()+"]"+Begin.getText(), mdd);


						}
						JOptionPane.showMessageDialog(null, "적용되었습니다.");
					}

				}
			});
			button_14.setBounds(10, 104, 73, 23);
		}
		return button_14;
	}
	private JButton getButton_3_1() {
		if (button_3 == null) {
			button_3 = new JButton("뒤로");
			button_3.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					editormain.setVisible(true);
					holyeditor.setVisible(false);
				}
			});
			button_3.setBounds(10, 137, 73, 23);
		}
		return button_3;
	}
	private JLabel getLblNewLabel_3() {
		if (lblNewLabel_3 == null) {
			lblNewLabel_3 = new JLabel("년");
		}
		return lblNewLabel_3;
	}
	private JLabel getLblNewLabel_4() {
		if (lblNewLabel_4 == null) {
			lblNewLabel_4 = new JLabel("월");
		}
		return lblNewLabel_4;
	}
	private JLabel getLblNewLabel_10() {
		if (lblNewLabel_10 == null) {
			lblNewLabel_10 = new JLabel("일");
		}
		return lblNewLabel_10;
	}
	private JLabel getLblNewLabel_12() {
		if (lblNewLabel_12 == null) {
			lblNewLabel_12 = new JLabel("yyyyMMdd");
			lblNewLabel_12.setBounds(12, 60, 71, 34);
		}
		return lblNewLabel_12;
	}
}
